home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Mac / macsetfiletype.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  369 b   |  25 lines  |  [TEXT/KAHL]

  1.  
  2. /*
  3.  *  macsetfiletype - Set the mac's idea of file type
  4.  *
  5.  */
  6.  
  7. #include "macdefs.h"
  8.  
  9. int
  10. setfiletype(name, creator, type)
  11. char *name;
  12. long creator, type;
  13. {
  14.     FInfo info;
  15.     unsigned char *pname;
  16.     
  17.     pname = (StringPtr) c2pstr(name);
  18.     if ( GetFInfo(pname, 0, &info) < 0 )
  19.         return -1;
  20.     info.fdType = type;
  21.     info.fdCreator = creator;
  22.     return SetFInfo(pname, 0, &info);
  23. }
  24.  
  25.